package com.gxl.butt.value;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by guoxiaolin on 2018/7/14.
 */
public class StaticValue {

    //创建固定数量线程池，线程达到上限后，进入等待
    public static final  ExecutorService THREAD_EXEC = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());

    //创建单线程，只会使用一个线程一个一个任务去执行，适合任务毫无时间要求的
    public static final  ExecutorService SINGLE_THREAD_EXECUTOR = Executors.newSingleThreadExecutor();

    /* 可缓存线程池，如果线程池长度超过处理需要，可灵活回收空闲线程，若无可回收，则新建线程。
      创建数量几乎没有限制(其实也有限制的,数目为Interger. MAX_VALUE), 这样可灵活的往线程池中添加线程 */
    public static final  ExecutorService CACHED_THREAD_POOL= Executors.newCachedThreadPool();


    /**判断 IP 格式的正则表达式**/
    public static final String REG_IP = "^(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\."+
            "(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\."+
            "(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\."+
            "(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$";

    /**判断 IP + 端口 格式的正则表达式**/
    public static final String REG_IP_PORT = "^(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\."+
            "(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\."+
            "(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\."+
            "(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)"+
            ":([0-9]|[1-9]\\d{1,3}|[1-5]\\d{4}|6[0-5]{2}[0-3][0-5])$";

    /* 即刻说 小程序appic */
    public static final String WX_APPID = "wx6a8b21ff3515c26f";
    /* 即刻说 小程序密匙 */
    public static final String WX_SECRET = "4386313175a6bdace677b5878b2a174b";



}
